/**
 * 
 */
package jgame.Inventory;

/**
 * @author Justin Sturm
 *
 */
public class JGameItem {
	String name;
	String stat;
	char op;
	int value;
	String description;
	
	public JGameItem(String n, String s, String d)
	{
		name = n;
		description = d;
		
		for(int i = 0; i<s.length(); i++)
		{
			if(s.charAt(i)=='%')
			{
				stat = s.substring(0,i);
				op = s.charAt(i+1);
				value = Integer.parseInt(s.substring(i+3,s.length()));
				break;
			}
		}
	}
	
	public void printItem()
	{
		System.out.println(name + "(" + stat + op + value + ")" + ": " + description);
	}
	
}
